package com.test.action;

import com.test.entity.UserInfo;
import com.test.service.UserInfoService;

public class UpdateAction extends BaseAction {
	private UserInfo userInfo;
	private UserInfoService userInfoService;

	public String update() throws Exception {
		UserInfo old = (UserInfo) this.getSession().get("userInfo");
		userInfo.setId(old.getId());
		userInfo.setMemberType(old.getMemberType());
		userInfo.setMoney(old.getMoney());
		userInfo.setSumScore(old.getSumScore());
		userInfo.setUserState(old.getUserState());
		userInfoService.updateUserInfo(userInfo);
		UserInfo user = userInfoService.querymoney(old.getUserName());
		this.getSession().put("userInfo", userInfo);
		return "user3";
	}

	public UserInfo getUserInfo() {
		return userInfo;
	}

	public void setUserInfo(UserInfo userInfo) {
		this.userInfo = userInfo;
	}

	public UserInfoService getUserInfoService() {
		return userInfoService;
	}

	public void setUserInfoService(UserInfoService userInfoService) {
		this.userInfoService = userInfoService;
	}

}
